package com.aaa.common.constants;

/**
 * @Author: YuXin
 * @Date : Created in 2020/11/9 16:05
 * @ClassName : Result
 * @Description : 枚举  自定义异常类型
 * @Package_Name : com.aaa.common.util
 */
public enum  ExceptionConstant {
    /**
     * 自定义异常枚举
     */
    ID_NOT_NULL(5001, "ID不能为NULL"),
    FIND_MODEL_BY_ID_ERROR(5002, "根据id查询数据时异常"),
    UNKNOWN_EXCEPTION(5003, "未知异常"),
    DATA_NOT_EXIST(5004, "数据不存在"),
    INVALID_ARGUMENT(5005, "无效的参数"),
    TOKEN_NOT_NULL(5006, "token不能为NULL"),
    NO_PERMISSION_ACCESS(5007, "无权查看该内容"),
    SYS_EXCEPTION(5008, "系统处理异常"),
    ERROR_USERNAME_OR_PASSWORD(5009, "用户名或密码错误");

    //错误码
    private int errorCode;
    //错误信息描述
    private String errorMessage;

    ExceptionConstant(int errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}
